#ifndef IMGENHANCEWIDGET_H
#define IMGENHANCEWIDGET_H

#include <QWidget>
#include <QFileDialog>
#include <QFileInfo>
#include <QDir>
#include <QMessageBox>
#include <QtConcurrent>
#include <QThread>
#include <QThreadPool>
#include <QTextEdit>
#include <QSettings>
#include <QTime>

#include "NvInferRuntimeCommon.h"
#include "NvInfer.h"
#include "NvOnnxParser.h"

#include "cuda_runtime_api.h"

#include "OnnxRuntimeObj.h"
#include "LoggerForTRT.h"

namespace Ui {
class ImgEnhanceWidget;
}

class ImgEnhanceWidget : public QWidget
{
    Q_OBJECT

public:
    explicit ImgEnhanceWidget(QWidget *parent = nullptr);
    ~ImgEnhanceWidget();


    void closeEvent(QCloseEvent *event);

signals:
    ///
    /// \brief onnxTRTBuilded
    /// onnx文件构建成TensorRT模型执行完成
    void trtEngineBuilded();

private slots:
    ///
    /// \brief toastInfo
    /// \param info
    /// \param color
    ///弹出信息到 信息栏
    void toastInfo(QString info,QString color="black");

    ///
    /// \brief toastVerbose
    /// \param info
    /// \param color
    /// 弹出冗余信息
    void toastVerbose(QString info,QString color="black");

    void on_btnGetFileName_clicked();

    void on_btnGetTRTFileName_clicked();

    void on_btnGetImagesPath_clicked();

    void on_btnRunByOrt_clicked();

    void on_btnGenTRTBin_clicked();

    void on_btnLoadAndRunTRT_clicked();

private:


    Ui::ImgEnhanceWidget *ui;

    QTextEdit m_verboseBox;

    //onnxruntime object
    OnnxRuntimeObj *m_onnxRtObj;

    //trt logger
    LoggerForTRT m_trtLogger;
};

#endif // IMGENHANCEWIDGET_H
